<template>
  <div>
    <div class="top">
      <span class="btn" @click="getInto">&lt;</span>
      <span class="nav">专栏详情</span>
    </div>
    <h2 v-html="specialDetails.title"></h2>
    <div class="img">
      <img :src="specialDetails.pic" alt="">
    </div>
    <div v-html="specialDetails.content" class="content"></div>

  </div>
</template>

<script>
import {mapState} from 'vuex'
  export default {
    mounted() {
      this.$store.dispatch('specialDetails', this.$route.query.id)
      // console.log(this.$route.query.id)
    },
    methods: {
      getInto() {
        this.$router.go(-1)
      }
    },
    computed: {
      ...mapState({
        specialDetails:state=>state.homeSwiper.specialDetails
      })
    },
  }
</script>

<style lang='scss' scoped>
  .top {
    width: 100%;
    height: 1rem;
    line-height: 1rem;
    font-size: 0.4rem;

    span {
      display: inline-block;
    }

    .btn {
      width: 1rem;
      height: 1rem;
      text-align: center;
    }

    .nav {
      margin-left: 2rem;
    }
  }
  h2{
    font-size: 0.5rem;
    text-align: center;
    margin-top: 0.5rem;
  }
  .img{
    width: 100%;
    padding: 0.2rem;
  }
  img{
    width: 100%;
  }
  .content{
    font-size: 0.35rem;
  }
</style>